/*
 * Created on Mon May 11 11:53:21 CEST 2009
 */
package se.sweco.dataservice;

import java.util.Dictionary;
import java.util.Hashtable;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import se.sweco.dataservice.impl.TinfoServiceImpl;

/* This bundle defines two services (TrafficDataService and TaxDataService)
 * Example of usage:
	ServiceTracker trafficTracker = new ServiceTracker(context, TrafficDataService.class.getName(), null);
	trafficTracker.open();
	TrafficDataService trafficService = (TrafficDataService)trafficTracker.getService();
	try {
		System.err.println("Traffic data: " + trafficService.getTrafficData(59, 18, 1000));
	} catch (TinfoWSException e) {
		System.err.println(e.getMessage());
		e.printStackTrace();
	}
 */
public class Activator implements BundleActivator {
  
  public void start(BundleContext context) throws Exception {
	  TinfoServiceImpl service = new TinfoServiceImpl();
	  
	  Hashtable props = new Hashtable();
	  props.put("description", "Fetch data from tinfows.");
	  String[] classNames = {TaxDataService.class.getName(), TrafficDataService.class.getName()};
	  context.registerService(classNames, service, props);
  }

  public void stop(BundleContext context) throws Exception {
  }
}